Zadig 文档
Zadig
教程
博客
论坛
关于
中文英文
Zadig
教程
博客
论坛
关于
Zadig v5.0
Loading...
     编辑文档
     反馈问题
     社区讨论

    本页导航

    Service

    Tip

    The OpenAPI described in this document applies to K8s YAML services.

    # Get Service List

    # Test Service

    Request

    GET /openapi/service/yaml/services?projectKey=<projectKey>
    
    1

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Response Description

    Parameter NameTypeDescription
    service_namestringService name
    typestringService type, fixed value k8s
    containers[]ContainerList of service components

    Container Parameter Description

    Parameter NameTypeDescription
    namestringService component name
    imagestringService component image
    image_namestringService component image name

    Response Example

    Details
    {
        "service": [
            {
                "service_name": "service-1",
                "type": "k8s",
                "containers": [
                    {
                        "name": "myapp-1",
                        "image": "koderover.tencentcloudcr.com/koderover-demo/myapp-1:v0.1__linux_amd64",
                        "image_name": "myapp-1"
                    }
                ]
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15

    # Production Service

    Request

    GET /openapi/service/yaml/production/services?projectKey=<projectKey>
    
    1

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Response Description

    Parameter NameTypeDescription
    service_namestringService name
    typestringService type, fixed value k8s
    containers[]ContainerList of service components

    Container

    Parameter NameTypeDescription
    namestringService component name
    imagestringService component image
    image_namestringService component image name

    Response Example

    Details
    [
            {
                "service_name": "service-1",
                "type": "k8s",
                "containers": [
                    {
                        "name": "myapp-1",
                        "image": "koderover.tencentcloudcr.com/koderover-demo/myapp-1:v0.1__linux_amd64",
                        "image_name": "myapp-1"
                    }
                ]
            }
    ]
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    # Get Service Details

    # Test Service

    Request

    GET /openapi/service/yaml/:serviceName?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Response Description

    Parameter NameTypeDescription
    service_namestringService name
    created_bystringService creator
    created_timeintService creation time
    typestringService type, fixed value k8s
    containers[]ContainerService component list
    service_variable_kvs[]KeyValService variable list
    yamlstringService configuration YAML content

    Container Parameter Description

    Parameter NameTypeDescription
    namestringService component name
    imagestringService component image
    image_namestringService component image name

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable keystringYes
    valueVariable value, if there is nested value, use json formatanyYes
    typeVariable value type, there are four types: bool, string, enum, yamlstringYes
    optionsVariable optional value list, this field has meaning when type is enum[]stringNo
    descVariable description informationStringNo

    Response Example

    Details
    {
        "service_name": "service2",
        "type": "k8s",
        "created_by": "admin",
        "created_time": 1689660993,
        "yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: service2\n  labels: \n    app.kubernetes.io/name: ai-test-2\n    app.kubernetes.io/instance: service2\n    hello: test\nspec:\n  selector:\n    matchLabels:\n      app.kubernetes.io/name: ai-test-2\n      app.kubernetes.io/instance: service2\n  replicas: 1\n  template:\n    metadata: \n      labels:\n        app.kubernetes.io/name: ai-test-2\n        app.kubernetes.io/instance: service2\n        hello: {{.world}}\n    spec:\n      containers:\n        - name: service2\n          image: koderover.******.com/koderover-demo/service2:latest\n          imagePullPolicy: Always \n          command:\n            - /workspace/service2\n          ports:\n            - protocol: TCP\n              containerPort: {{.port}}\n          resources:\n            limits:\n              memory: {{.memoryLimit}}\n              cpu: {{.cpuLimit}}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: service2\n  labels:\n    app.kubernetes.io/name: ai-test-2\n    app.kubernetes.io/instance: service2\nspec:\n  type: NodePort\n  ports:\n    - protocol: TCP\n      port: {{.port}}\n      targetPort: {{.port}}",
        "containers": [
            {
                "name": "service2",
                "image": "koderover.******.com/koderover-demo/service2:latest",
                "image_name": "service2"
            }
        ],
        "service_variable_kvs": [
            {
                "key": "cpuLimit",
                "value": "55m",
                "type": "string",
                "options": [],
                "desc": ""
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    # Production Service

    Request

    GET /openapi/service/yaml/production/:serviceName?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Response Description

    Parameter NameTypeDescription
    service_namestringService name
    created_bystringService creator
    created_timeintService creation time
    typestringService type, fixed value k8s
    containers[]ContainerService component list
    service_variable_kvs[]KeyValService variable list
    yamlstringService configuration YAML content

    Container Parameter Description

    Parameter NameTypeDescription
    namestringService component name
    imagestringService component image
    image_namestringService component image name

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable keystringYes
    valueVariable value, if there is nested value, use json formatanyYes
    typeVariable value type, there are four types: bool, string, enum, yamlstringYes
    optionsVariable optional value list, this field has meaning when type is enum[]stringNo
    descVariable description informationStringNo

    Response Example

    Details
    {
        "service_name": "service2",
        "type": "k8s",
        "created_by": "admin",
        "created_time": 1689660993,
        "yaml": "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: service2\n  labels: \n    app.kubernetes.io/name: ai-test-2\n    app.kubernetes.io/instance: service2\n    hello: test\nspec:\n  selector:\n    matchLabels:\n      app.kubernetes.io/name: ai-test-2\n      app.kubernetes.io/instance: service2\n  replicas: 1\n  template:\n    metadata: \n      labels:\n        app.kubernetes.io/name: ai-test-2\n        app.kubernetes.io/instance: service2\n        hello: {{.world}}\n    spec:\n      containers:\n        - name: service2\n          image: koderover.******.com/koderover-demo/service2:latest\n          imagePullPolicy: Always \n          command:\n            - /workspace/service2\n          ports:\n            - protocol: TCP\n              containerPort: {{.port}}\n          resources:\n            limits:\n              memory: {{.memoryLimit}}\n              cpu: {{.cpuLimit}}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: service2\n  labels:\n    app.kubernetes.io/name: ai-test-2\n    app.kubernetes.io/instance: service2\nspec:\n  type: NodePort\n  ports:\n    - protocol: TCP\n      port: {{.port}}\n      targetPort: {{.port}}",
        "containers": [
            {
                "name": "service2",
                "image": "koderover.******.com/koderover-demo/service2:latest",
                "image_name": "service2"
            }
        ],
        "service_variable_kvs": [
            {
                "key": "cpuLimit",
                "value": "55m",
                "type": "string",
                "options": [],
                "desc": ""
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23

    # Get Service Labels

    Request

    GET /openapi/service/yaml/:serviceName/labels?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Response Example

    Correct return

    [
      {
        "key": "key",
        "value": "value"
      },
      ...
    ]
    
    1
    2
    3
    4
    5
    6
    7

    Error return

    {
      "code": 500,
      "description": "...",
      "message": "Internal Error"
    }
    
    1
    2
    3
    4
    5

    # Create New Service Using Template

    # Test Service

    Request

    POST /openapi/service/template/load/yaml
    
    1

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    service_nameService namestringYes
    project_keyProject keystringYes
    template_nameK8s Yaml Template NamestringYes
    auto_syncAuto sync switchboolNo
    variable_yamlTemplate variable information[]KeyValNo

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable key valuestringYes
    valueVariable value, if there is nested value, use json formatanyYes

    Body Parameter Example

    Use template microservice-template to create service service1 for project demo:

    Details
    {
        "service_name": "service1",
        "project_key":"demo",
        "template_name": "microservice-template",
        "auto_sync": true,
        "variable_yaml": [
            {
                "key": "cpuLimit",
                "value": "100m"
            },
            {
                "key": "memoryLimit",
                "value": "100Mi"
            },
            {
                "key": "port",
                "value": "20221"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Service

    Request

    POST /openapi/service/template/production/load/yaml
    
    1

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    service_nameService namestringYes
    yamlService YAML contentstringYes
    project_keyProject keystringYes
    template_nameK8s Yaml Template NamestringYes
    auto_syncAuto sync switchboolNo
    variable_yamlTemplate variable information[]KeyValNo

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable key valuestringYes
    valueVariable value, if there is nested value, use json formatanyYes

    Body Parameter Example

    Use template base-template to create service service1 for project demo:

    Details
    {
        "service_name": "service1",
        "production":true,
        "project_key":"demo",
        "template_name":"base-template",
        "auto_sync":true,
        "variable_yaml":[
            {
                "key":"cpuLimit",
                "value":"15m"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Create New Service Manually

    # Test Service

    Request

    POST /openapi/service/yaml/raw?projectKey=<projectKey>
    
    1

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    service_nameService namestringYes
    yamlService YAML contentstringYes
    variable_yamlyaml variable information[]KeyValNo

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable keystringYes
    valueVariable value, if there is nested value, use json formatanyYes
    typeVariable value type, there are four types: bool, string, enum, yamlstringYes
    optionsVariable optional value list, this field has meaning when type is enum[]stringNo
    descVariable description informationStringNo

    Body Parameter Example

    Details
    {
        "service_name":"service-3",
        "yaml":"apiVersion: v1\nkind: Service\nmetadata:\n  name: a\n  labels:\n    app: a\nspec:\n  ports:\n  - name: http\n    port: 80\n    targetPort: 8080\n  selector:\n    app: a\n\n---\n\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: a\n  labels:\n    app: a\nspec:\n  selector:\n    matchLabels:\n      app: a\n  replicas: 1\n  template:\n    metadata:\n      labels:\n        app: a\n    spec:\n      containers:\n      - name: myapp-1\n        image: koderover.******.com/koderover-demo/myapp-1:v0.1__linux_amd64\n        imagePullPolicy: Always\n        command: [\"/myapp-1\"]\n        args: [\"--downstream-addr\", \"$(DOWNSTREAM_ADDR)\", \"--headers\", \"$(HEADERS)\"]\n        env:\n          - name: DOWNSTREAM_ADDR\n            value: \"b\"\n          - name: HEADERS\n            value: \"x-request-id\"\n        ports:\n        - containerPort: 8080\n        resources:\n          limits:\n            cpu: {{.cpu}}\n            memory: 122Mi\n",
        "variable_yaml":[
            {
                "key":"cpu",
                "value":"12m",
                "desc":"cpu value",
                "type":"string"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Service

    Request

    POST /openapi/service/yaml/production/raw?projectKey=<projectKey>
    
    1

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    service_nameService namestringYes
    yamlService YAML contentstringYes
    variable_yamlyaml variable information[]KeyValNo

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable keystringYes
    valueVariable value, if there is nested value, use json formatanyYes
    typeVariable value type, there are four types: bool, string, enum, yamlstringYes
    optionsVariable optional value list, this field has meaning when type is enum[]stringNo
    descVariable description informationStringNo

    Body Parameter Example

    Details
    {
        "service_name":"service-3",
        "yaml":"apiVersion: v1\nkind: Service\nmetadata:\n  name: a\n  labels:\n    app: a\nspec:\n  ports:\n  - name: http\n    port: 80\n    targetPort: 8080\n  selector:\n    app: a\n\n---\n\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: a\n  labels:\n    app: a\nspec:\n  selector:\n    matchLabels:\n      app: a\n  replicas: 1\n  template:\n    metadata:\n      labels:\n        app: a\n    spec:\n      containers:\n      - name: myapp-1\n        image: koderover.******.com/koderover-demo/myapp-1:v0.1__linux_amd64\n        imagePullPolicy: Always\n        command: [\"/myapp-1\"]\n        args: [\"--downstream-addr\", \"$(DOWNSTREAM_ADDR)\", \"--headers\", \"$(HEADERS)\"]\n        env:\n          - name: DOWNSTREAM_ADDR\n            value: \"b\"\n          - name: HEADERS\n            value: \"x-request-id\"\n        ports:\n        - containerPort: 8080\n        resources:\n          limits:\n            cpu: {{.cpu}}\n            memory: 122Mi\n",
        "variable_yaml":[
            {
                "key":"cpu",
                "value":"12m",
                "desc":"cpu value",
                "type":"string"
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Create K8s YAML Service from Code Repository

    Request

    POST /openapi/service/loader/load?codehostName=<codehostName>&repoName=<repoName>&branchName=<branchName>&remoteName=<remoteName>&repoOwner=<repoOwner>&namespace=<namespace>&production=<production>
    
    1

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    codehostNamestringCode source nameYes
    repoNamestringRepository nameYes
    branchNamestringBranch where the service configuration is locatedYes
    remoteNamestringGit remote name used for Gerrit, Gitee, and Gitee Enterprise; defaults to origin when emptyNo
    repoOwnerstringRepository owner or organizationYes
    namespacestringGitHub/GitLab repository namespace. If empty, repoOwner is usedNo
    productionboolWhether to create a production service. Only true creates a production service; defaults to falseNo

    Body Parameters

    Parameter NameDescriptionTypeRequired
    product_nameProject KeystringYes
    service_pathsService path list[]LoadServicePathYes

    LoadServicePath Parameters

    Parameter NameDescriptionTypeRequired
    service_nameService namestringYes
    pathRelative path of the service configuration file or directory. When is_dir is true, an empty string selects the repository rootstringConditional
    is_dirWhether the path is a directory. true loads a directory and false loads one YAML file; defaults to falseboolNo

    Request Example

    Create a test service for project demo from the main branch of codehost github-demo:

    POST /openapi/service/loader/load?codehostName=github-demo&repoName=demo&branchName=main&repoOwner=koderover&production=false
    
    1

    Body Parameter Example

    Details
    {
        "product_name": "demo",
        "service_paths": [
            {
                "service_name": "backend",
                "path": "services/backend/deployment.yaml",
                "is_dir": false
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    # Create Helm Service

    Create Helm services from a code repository, public repository, or Chart repository.

    Request

    POST /openapi/service/helm/load?projectKey=<projectKey>
    
    1

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Body Parameters

    Parameter NameDescriptionTypeRequired
    sourceService source enum. See the value mapping belowstringYes
    productionWhether to create a production service; defaults to falseboolNo
    createFromService source configuration. See the following sections for fields by sourceobjectYes

    source Values

    ValueMeaning
    repoAn integrated GitHub, GitLab, or generic Git code source of type other
    gerritAn integrated Gerrit code source
    giteeAn integrated Gitee code source
    gitee-enterpriseAn integrated Gitee Enterprise code source
    publicRepoA public GitHub repository
    chartRepoAn integrated Chart repository

    createFrom Parameters for Integrated Code Sources

    This applies when source is repo, gerrit, gitee, or gitee-enterprise.

    Parameter NameDescriptionTypeRequired
    codehostNameCode source namestringYes
    ownerRepository owner or organizationstringYes
    namespaceRepository namespace, used for multi-level GitLab groups. If empty, owner is usedstringNo
    repoRepository namestringYes
    branchBranch namestringYes
    pathsChart path list. Multiple paths are supported[]stringYes

    createFrom Parameters When source Is publicRepo

    Parameter NameDescriptionTypeRequired
    repoLinkPublic repository URLstringYes
    pathsChart path list. Multiple paths are supported[]stringYes

    createFrom Parameters When source Is chartRepo

    Parameter NameDescriptionTypeRequired
    chartRepoNameChart repository namestringYes
    chartNameChart namestringYes
    chartVersionChart version constraint. If empty, no version is specified and Helm resolves an available versionstringNo

    Body Parameter Example

    Create a Helm service for project demo from the main branch of codehost github-demo:

    Details
    {
        "source": "repo",
        "production": false,
        "createFrom": {
            "codehostName": "github-demo",
            "owner": "koderover",
            "repo": "helm-charts",
            "branch": "main",
            "paths": [
                "charts/backend"
            ]
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13

    Response Description

    Parameter NameDescriptionType
    successServicesList of services created successfully[]string
    failedServicesList of services that failed to create[]FailedHelmService

    FailedHelmService Parameters

    Parameter NameDescriptionType
    pathChart path that failedstring
    errorFailure reasonstring

    Response Example

    Details
    {
        "successServices": [
            "backend"
        ],
        "failedServices": []
    }
    
    1
    2
    3
    4
    5
    6

    # Update Service Configuration

    # Test Service

    # Request

    PUT /openapi/service/yaml/:serviceName?projectKey=<project_name>
    
    1

    # Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    # Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    # Body Parameter Description

    Parameter NameDescriptionTypeRequired
    typeService type, specify as k8sstringYes
    yamlService configuration YAML contentstringYes

    Body Parameter Example

    Details
    {
        "type":"k8s",
        "yaml":"apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: service1\n  labels: \n    app.kubernetes.io/name: demo\n    app.kubernetes.io/instance: service1\nspec:\n  selector:\n    matchLabels:\n      app.kubernetes.io/name: demo\n      app.kubernetes.io/instance: service1\n  replicas: 1\n  template:\n    metadata: \n      labels:\n        app.kubernetes.io/name: demo\n        app.kubernetes.io/instance: service1\n    spec:\n      containers:\n        - name: service1\n          image: koderover.******.com/koderover-demo/service1:latest\n          imagePullPolicy: Always \n          command:\n            - /workspace/service1\n          ports:\n            - protocol: TCP\n              containerPort: {{.port}}\n          resources:\n            limits:\n              memory: {{.memoryLimit}}\n              cpu: {{.cpuLimit}}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: service1\n  labels:\n    app.kubernetes.io/name: yaml-poc\n    app.kubernetes.io/instance: service1\nspec:\n  type: NodePort\n  ports:\n    - protocol: TCP\n      port: {{.port}}\n      targetPort: {{.port}}\n",
    }
    
    1
    2
    3
    4

    # Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Service

    Request

    PUT /openapi/service/yaml/production/:serviceName?projectKey=<project_name>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    typeService type, specify as k8sstringYes
    yamlService configuration YAML contentstringYes

    Body Parameter Example

    Details
    {
        "type":"k8s",
        "yaml":"apiVersion: apps/v1\nkind: Deployment\nmetadata:\n  name: service1\n  labels: \n    app.kubernetes.io/name: demo\n    app.kubernetes.io/instance: service1\nspec:\n  selector:\n    matchLabels:\n      app.kubernetes.io/name: demo\n      app.kubernetes.io/instance: service1\n  replicas: 1\n  template:\n    metadata: \n      labels:\n        app.kubernetes.io/name: demo\n        app.kubernetes.io/instance: service1\n    spec:\n      containers:\n        - name: service1\n          image: koderover.******.com/koderover-demo/service1:latest\n          imagePullPolicy: Always \n          command:\n            - /workspace/service1\n          ports:\n            - protocol: TCP\n              containerPort: {{.port}}\n          resources:\n            limits:\n              memory: {{.memoryLimit}}\n              cpu: {{.cpuLimit}}\n---\napiVersion: v1\nkind: Service\nmetadata:\n  name: service1\n  labels:\n    app.kubernetes.io/name: yaml-poc\n    app.kubernetes.io/instance: service1\nspec:\n  type: NodePort\n  ports:\n    - protocol: TCP\n      port: {{.port}}\n      targetPort: {{.port}}\n",
    }
    
    1
    2
    3
    4

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Update Service Variable

    # Test Service

    Request

    PUT /openapi/service/yaml/:serviceName/variable?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    service_variable_kvsService variable list[]KeyValYes

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable keystringYes
    valueVariable value, if there is nested value, use json formatanyYes
    typeVariable value type, there are four types: bool, string, enum, yamlstringYes
    optionsVariable optional value list, this field has meaning when type is enum[]stringNo
    descVariable description informationStringNo

    Body Parameter Example

    Details
    {
        "service_variable_kvs": [
            {
                "key":"cpu",
                "value":"12m",
                "type":"string",
              	"options":[],
              	"desc":""
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Service

    Request

    PUT /openapi/service/yaml/production/:serviceName/variable?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Body Parameter Description

    Parameter NameDescriptionTypeRequired
    service_variable_kvsService variable list[]KeyValYes

    KeyVal Parameter Description

    Parameter NameDescriptionTypeRequired
    keyVariable keystringYes
    valueVariable value, if there is nested value, use json formatanyYes
    typeVariable value type, there are four types: bool, string, enum, yamlstringYes
    optionsVariable optional value list, this field has meaning when type is enum[]stringNo
    descVariable description informationStringNo

    Body Parameter Example

    Details
    {
        "service_variable_kvs": [
            {
                "key":"cpu",
                "value":"12m",
                "type":"string",
              	"options":[],
              	"desc":""
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Delete Service

    # Test Service

    # Request

    DELETE /openapi/service/yaml/<serviceName>?projectKey=<projectKey>
    
    1

    # Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Production Service

    Request

    DELETE /openapi/service/yaml/production/:serviceName?projectKey=<projectKey>
    
    1

    Path Parameter Description

    Parameter NameTypeDescriptionRequired
    serviceNamestringService nameYes

    Query Parameter Description

    Parameter NameTypeDescriptionRequired
    projectKeystringProject KeyYes

    Return

    {
      "message": "success"
    }
    
    1
    2
    3

    # Create Helm Service from Template

    Request

    POST /openapi/service/template/load/helm?projectKey=<projectKey>
    
    1

    Body Parameters

    Parameter NameDescriptionTypeRequired
    project_keyProject KeystringYes
    service_nameService NamestringYes
    productionIs Production EnvironmentboolNo
    template_nameHelm Template NamestringYes
    values_yamlValues YAML ContentstringNo
    variablesTemplate Variable Info[]KeyValNo
    auto_syncAuto Sync SwitchboolNo

    KeyVal Parameters

    Parameter NameDescriptionTypeRequired
    keyVariable KeystringYes
    valueVariable Value, use json format if nestedanyYes

    Body Parameter Example

    Create service api-test for project multi-chart using template general-chart:

    Details
    {
        "auto_sync": true,
        "production": false,
        "project_key": "multi-chart",
        "service_name": "api-test",
        "template_name": "general-chart",
        "values_yaml": "aa: bb\ncc: dd",
        "variables": [
            {
                "key": "port",
                "value": 20012
            }
        ]
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    Response

    {
      "message": "success"
    }
    
    1
    2
    3

    ← EnvironmentBuild→

    资源
    教程
    论坛
    博客
    公司
    关于
    客户故事
    加入我们
    联系我们
    微信扫一扫
    hello@koderover.com

    © 2026 筑栈(上海)信息技术有限公司 沪 ICP 备 19000177 号 - 1

    •  跟随系统
    •  浅色模式
    •  深色模式
    •  阅读模式